mediabox {
    .box {
        $mediabox-transition-duration: .1s;
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 41;
        background-color: rgba(0, 0, 0, .75);
        padding: 24px;

        &.ng-enter {
            transition: $mediabox-transition-duration linear opacity;
            opacity: 0;

            img {
                transform: scale(.95);
                transition: $mediabox-transition-duration linear transform;
            }
        }

        &.ng-enter-active {
            opacity: 1;

            img {
                transform: scale(1);
            }
        }

        &.ng-leave {
            transition: $mediabox-transition-duration linear opacity;
            opacity: 1;

            img {
                transform: scale(1);
                transition: $mediabox-transition-duration linear transform;
            }
        }

        &.ng-leave-active {
            opacity: 0;

            img {
                transform: scale(.95);
            }
        }


        md-icon {
            display: block;
            position: absolute;
            top: 24px;
            border: 2px solid rgba(255, 255, 255, .8);
            border-radius: 50%;
            background-color: rgba(0, 0, 0, .7);
            cursor: pointer;
            width: 28px;
            height: 28px;
            color: rgba(255, 255, 255, .8);
            box-sizing: border-box;
            user-select: none;

            &:focus {
                border: 2px solid rgba(255, 255, 255, 1);
                color: rgba(255, 255, 255, 1);
            }

            &.save {
                right: 60px;
                padding: 2px;
                font-size: 20px;
            }

            &.close {
                right: 24px;
            }
        }

        .inner {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            width: 100%;
            height: 100%;

            &:focus {
                outline: 0;
            }

            img {
                box-shadow: 0 0 50px rgba(0, 0, 0, .7);
                max-width: 100%;
                max-height: calc(100% - 28px - 28px);
                user-select: none;
            }

            .caption {
                display: block;
                margin: 4px 0 0;
                max-width: 90%;
                overflow: hidden;
                text-overflow: ellipsis;
                line-height: 1.3em;
                white-space: nowrap;
                color: rgba(255, 255, 255, .8);
                font-size: 1.3em;
            }
        }
    }
}
